// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'ZMsSqlQuery.pas' rev: 5.00

#ifndef ZMsSqlQueryHPP
#define ZMsSqlQueryHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <ZSqlItems.hpp>	// Pascal unit
#include <ZSqlTypes.hpp>	// Pascal unit
#include <ZQuery.hpp>	// Pascal unit
#include <ZSqlExtra.hpp>	// Pascal unit
#include <ZLibMsSql.hpp>	// Pascal unit
#include <ZToken.hpp>	// Pascal unit
#include <ZMsSqlTr.hpp>	// Pascal unit
#include <ZMsSqlCon.hpp>	// Pascal unit
#include <DBCommon.hpp>	// Pascal unit
#include <ZDirMsSql.hpp>	// Pascal unit
#include <ZDirSql.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Db.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Zmssqlquery
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TZZMsSqlOption { soStoreResult };
#pragma option pop

typedef Set<TZZMsSqlOption, soStoreResult, soStoreResult>  TZZMsSqlOptions;

class DELPHICLASS TZZCustomMsSqlDataset;
class PASCALIMPLEMENTATION TZZCustomMsSqlDataset : public Zquery::TZZDataset 
{
	typedef Zquery::TZZDataset inherited;
	
private:
	TZZMsSqlOptions FExtraOptions;
	Zdirmssql::TDirMsSqlConnect* FUseConnect;
	Zdirmssql::TDirMsSqlTransact* FUseTransact;
	HIDESBASE void __fastcall SetDatabase(Zmssqlcon::TZZMsSqlDatabase* Value);
	HIDESBASE void __fastcall SetTransact(Zmssqltr::TZZMsSqlTransact* Value);
	Zmssqlcon::TZZMsSqlDatabase* __fastcall GetDatabase(void);
	Zmssqltr::TZZMsSqlTransact* __fastcall GetTransact(void);
	int __fastcall GetIdentField(AnsiString Table);
	
protected:
	virtual void __fastcall QueryRecord(void);
	virtual void __fastcall UpdateAfterPost(Zsqltypes::PRecordData OldData, Zsqltypes::PRecordData NewData
		);
	virtual void __fastcall CreateConnections(void);
	virtual void __fastcall InternalClose(void);
	
public:
	__fastcall virtual TZZCustomMsSqlDataset(Classes::TComponent* AOwner);
	__fastcall virtual ~TZZCustomMsSqlDataset(void);
	virtual void __fastcall AddTableFields(AnsiString Table, Zsqlitems::TSqlFields* SqlFields);
	virtual void __fastcall AddTableIndices(AnsiString Table, Zsqlitems::TSqlFields* SqlFields, Zsqlitems::TSqlIndices* 
		SqlIndices);
	
__published:
	__property Zmssqlcon::TZZMsSqlDatabase* Database = {read=GetDatabase, write=SetDatabase};
	__property Zmssqltr::TZZMsSqlTransact* Transaction = {read=GetTransact, write=SetTransact};
	__property TZZMsSqlOptions ExtraOptions = {read=FExtraOptions, write=FExtraOptions, nodefault};
};


class DELPHICLASS TZZMsSqlQuery;
class PASCALIMPLEMENTATION TZZMsSqlQuery : public TZZCustomMsSqlDataset 
{
	typedef TZZCustomMsSqlDataset inherited;
	
public:
	__property MacroCount ;
	__property ParamCount ;
	
__published:
	__property MacroChar ;
	__property Macros ;
	__property MacroCheck ;
	__property Params ;
	__property ParamCheck ;
	__property DataSource ;
	__property Sql ;
	__property RequestLive ;
	__property Database ;
	__property Transaction ;
	__property Active ;
public:
	#pragma option push -w-inl
	/* TZZCustomMsSqlDataset.Create */ inline __fastcall virtual TZZMsSqlQuery(Classes::TComponent* AOwner
		) : TZZCustomMsSqlDataset(AOwner) { }
	#pragma option pop
	#pragma option push -w-inl
	/* TZZCustomMsSqlDataset.Destroy */ inline __fastcall virtual ~TZZMsSqlQuery(void) { }
	#pragma option pop
	
};


class DELPHICLASS TZZMsSqlTable;
class PASCALIMPLEMENTATION TZZMsSqlTable : public TZZCustomMsSqlDataset 
{
	typedef TZZCustomMsSqlDataset inherited;
	
public:
	__fastcall virtual TZZMsSqlTable(Classes::TComponent* AOwner);
	
__published:
	__property TableName ;
	__property ReadOnly ;
	__property DefaultIndex ;
	__property Database ;
	__property Transaction ;
	__property Active ;
public:
	#pragma option push -w-inl
	/* TZZCustomMsSqlDataset.Destroy */ inline __fastcall virtual ~TZZMsSqlTable(void) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------
static const Word LIST_BLOCK_SIZE = 0x1f4;
static const Shortint MIN_FETCH_ROWS = 0x0;
static const Shortint MAX_NAME_LENGTH = 0x32;
static const Shortint MAX_LINKS_COUNT = 0x5;
static const Shortint MAX_SORT_COUNT = 0x5;
static const Byte MAX_FIELD_COUNT = 0xff;
static const Shortint MAX_INDEX_COUNT = 0x19;
static const Shortint MAX_INDEX_FIELDS = 0x19;
static const Shortint DEFAULT_STRING_SIZE = 0x32;
static const Word MAX_STRING_SIZE = 0x200;
static const char DEFAULT_MACRO_CHAR = '\x25';
#define ZEOS_PALETTE "Zeos Common"
#define ZEOS_DB_PALETTE "Zeos Access"
static const Word ZDBO_VERSION = 0xc47c;

}	/* namespace Zmssqlquery */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Zmssqlquery;
#endif
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// ZMsSqlQuery
